from werkzeug.security import generate_password_hash, check_password_hash

class DummyUserManager:
    def __init__(self):
        self.user_map = {
            1: User(1, "pusheen", "meow"),
            2: User(2, "stormy", "meow2"),
            3: User(3, "meow1", "meow1"),
            4: User(4, "meow2", "meow2")
        }

    def get_user(self, user_id):
        return self.user_map.get(user_id, None)

    def get_user_by_username(self, username):
        for user_id in self.user_map.keys():
            user = self.user_map.get(user_id)
            if user.username == username:
                return user
        return None

class User:
    def __init__(self, userid, username, password):
        self.id = userid
        self.username = username
        self.password = generate_password_hash(password)

    def get_public_user(self):
        return {"id": self.id, "username": self.username}
